import unittest
from htmltestreport import HTMLTestReport

from config import BASE_DIR

if __name__ == '__main__':
    # 2. 生成测试套件
    # suite = unittest.defaultTestLoader.discover(BASE_DIR + '/scripts', 'test*')
    suite = unittest.defaultTestLoader.discover('./scripts/')

    # 3. 实例化HTMLTestRunner对象
    # report = HTMLTestReport(BASE_DIR+'/report/report.html',
    #                         title="IHRM测试报告",
    #                         description="V1.0")

    report = HTMLTestReport('./report/report.html',
                            title="IHRM测试报告",
                            description="V1.0")

    # 4. 执行测试套件
    report.run(suite)
